<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/customer/Customer.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/demo/customer/Customer.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'CustomerId',
                footer: "Foots",
                cnName: '客户信息',
                name: 'customer/Customer',
                url: "/Customer/",
                sortName: "CustomerId"
            });
            const editFormFields = ref({"Customername":"","Phone":"","Sd":"","sheng":"","shi":"","xian":"","bz":""});
            const editFormOptions = ref([[{"title":"客户名称","field":"Customername"},
                               {"title":"电话","field":"Phone"},
                               {"dataKey":"enable","data":[],"title":"是否锁定","field":"Sd","type":"select"}],
                              [{"dataKey":"省","data":[],"title":"省","field":"sheng","type":"select"},
                               {"dataKey":"市","data":[],"title":"市","field":"shi","type":"select"},
                               {"title":"县","field":"xian"}],
                              [{"title":"备注","field":"bz"}]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'CustomerId',title:'CustomerId',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'Customername',title:'客户名称',type:'string',width:220,align:'left',sort:true},
                       {field:'Phone',title:'电话',type:'string',width:220,align:'left'},
                       {field:'sheng',title:'省',type:'string',bind:{ key:'省',data:[]},width:220,align:'left'},
                       {field:'shi',title:'市',type:'string',bind:{ key:'市',data:[]},width:220,align:'left'},
                       {field:'xian',title:'县',type:'string',width:220,align:'left'},
                       {field:'Sd',title:'是否锁定',type:'int',bind:{ key:'enable',data:[]},width:80,align:'left'},
                       {field:'CreateID',title:'CreateID',type:'int',width:100,hidden:true,align:'left'},
                       {field:'bz',title:'备注',type:'string',width:220,align:'left'},
                       {field:'Creator',title:'创建人',type:'string',width:100,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'ModifyID',title:'ModifyID',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人',type:'string',width:100,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,align:'left',sort:true}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
